﻿/*
 * @Author: song
 * @Description:IOS平台构建设置
 * @Date: 2024年04月20日 星期六 12:04:11
 * @Modify:
 */

using UnityEditor;
using UnityEngine.iOS;
using UnityEngine.Rendering;

namespace SCore.Editor.BuildPackage.Platform
{
    public class BuildIOSPlatform : BuildPlatformBase
    {
        public override void SBuild()
        {
            base.SBuild();

            var sBuildChannel = BuildPipelineConfig.Instance._buildChannel;
            BuildPipelineConfig.Instance._isExportAAb = false; //强制设置为false
            //ios 设置
            PlayerSettings.iOS.requiresFullScreen = true; //是否需要全屏
            PlayerSettings.SetGraphicsAPIs(sBuildChannel.GetBuildTarget(),
                new GraphicsDeviceType[] { GraphicsDeviceType.Metal }); //使用的图像API
            PlayerSettings.iOS.appleEnableAutomaticSigning = false;
            PlayerSettings.iOS.allowHTTPDownload = true;
            PlayerSettings.iOS.targetDevice = iOSTargetDevice.iPhoneAndiPad;
            PlayerSettings.iOS.sdkVersion = iOSSdkVersion.DeviceSDK;
            PlayerSettings.iOS.targetOSVersionString = "12";
            PlayerSettings.iOS.hideHomeButton = true;
            PlayerSettings.iOS.deferSystemGesturesMode = SystemGestureDeferMode.All;
            PlayerSettings.iOS.locationUsageDescription = "For Game";
            PlayerSettings.iOS.buildNumber = BuildPipelineConfig.Instance._bundleVersionCode;
            PlayerSettings.iOS.iOSManualProvisioningProfileID = string.Empty;
            PlayerSettings.iOS.iOSManualProvisioningProfileType = ProvisioningProfileType.Automatic;

            PlayerSettings.iOS.appleDeveloperTeamID = sBuildChannel._teamId;
            PlayerSettings.iOS.iOSManualProvisioningProfileID = sBuildChannel._iOSManualProvisioningProfileID;
            PlayerSettings.iOS.iOSManualProvisioningProfileType = sBuildChannel._iOSManualProvisioningProfileType;

            // CGSettings.IosTeamID = BuildPipeline._teamId;
            // CGSettings.IosNotificationServiceProvision = channelInfo._IosNotificationServiceProvision;
            // CGSettings.IosProvision = channelInfo._iOSManualProvisioningProfileID;
            // CGSettings.GitlabPodToken = "glpat-tNG9JyFUTM3JHWs1zgmg";
        }
    }
}